<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //Math函数
    //不需要创建对象，直接使用
    //Math.round() 四舍五入的操作
    var result1 = Math.round(1.3);
    console.log(result1);

    var num = 2.16;
    num = num*10;
    var result2 = Math.round(num);
    result2 = result2/10;
    console.log(result2);


    //Math.floor 向下取整
    //Math.ceil 向上取整
    var result3 = Math.floor(1.3);
    var result4 = Math.ceil(1.3);
    console.log(result3,result4)


</script>
</html>